import Home from "../layout/Home.vue";

/**
 * 管理员后台页面（控制台路由）
 * 1、管理员和用户是同一个控制台
 *    通过meta.isAdmin: true, // 仅管理员可见
 * icon 菜单栏的小图标
 * title 标题
 */
export default {
    path: "/admin",
    name: "admin",
    redirect: "/dashboard",
    component: Home,
    children: [
        {
            path: "/dashboard",
            name: "dashboard",
            meta: {
                title: '系统首页',
                icon: "s-home"
            },
            component: () => import ( /* webpackChunkName: "base" */ "../views/Dashboard.vue")
        }, {
            path: "/service",
            name: "serviceIndex",
            meta: {
                title: '汽车服务包',
                icon: "sell",
                isAdmin: true, // 仅管理员可见
            },
            component: () => import ( /* webpackChunkName: "admin" */ "../views/service/Service.vue")
        }, {
            path: "/goods",
            name: "goodsIndex",
            meta: {
                title: '汽车商品',
                icon: "s-goods",
                isAdmin: true, // 仅管理员可见
            },
            component: () => import ( /* webpackChunkName: "admin" */ "../views/goods/Goods.vue")
        }, {
            path: '/member',
            name: 'member',
            meta: {
                title: '用户管理',
                icon: "user-solid",
                isAdmin: true, // 仅管理员可见
            },
            component: () => import (/* webpackChunkName: "admin" */ '../views/member/Member.vue')
        }, {
            path: '/orders',
            name: 'orders',
            meta: {
                icon: "document",
                title: '订单列表',
            },
            component: () => import (/* webpackChunkName: "base" */ '../views/orders/Orders.vue')
        },
        {
            path: '/user',
            name: 'user',
            meta: {
                title: '个人中心',
                notAdmin: true, // 非管理员可见
            },
            component: () => import (/* webpackChunkName: "base" */ '../views/User.vue')
        },
        // {
        //     path: "/icon",
        //     name: "icon",
        //     meta: {
        //         title: '自定义图标'
        //     },
        //     component: () => import ( /* webpackChunkName: "icon" */ "../views/Icon.vue")
        // },

    ]
}
